/*
package com.zhou.common.mybatis.template.config;


import com.digital.cnzz.zhenghuiqi.service.web.auth.admin.TraceFilter;
import com.digital.cnzz.zhenghuiqi.service.web.auth.admin.UserCenterFilter;
import com.digital.cnzz.zhenghuiqi.service.web.auth.web.PortalSecurityInterceptor;
import com.digital.cnzz.zhenghuiqi.service.web.auth.web.SSOProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@EnableConfigurationProperties({SSOProperties.class})
@Configuration
public class MyWebMvcConfigurerAdapter implements WebMvcConfigurer {

    @Autowired
    private PortalSecurityInterceptor portalSecurityInterceptor;
    @Autowired
    private SSOProperties ssoProperties;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
        registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
        registry.addResourceHandler("/swagger/**").addResourceLocations("classpath:/static/swagger/");
        registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");

    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(portalSecurityInterceptor)
                .addPathPatterns("/web/**")
                .excludePathPatterns("/swagger-resources/**"
                        , "/webjars/**"
                        , "/swagger-ui.html/**"
                        , "/web/latest/gather/query"
                        , "/web/project/query"
                        , "/web/search"
                        , "/web/statistics"
                        , "/web/policy/**"
                );
    }

*/
/*    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**") // TODO 暂时写所有 后面将可以访问的域名配置在属性文件
//                .allowedOriginPatterns("test")
//                .allowCredentials(true)
                .allowedHeaders("*")
                .allowedOrigins("*")
                .allowedMethods("*");
    }*//*


    @Bean
    public FilterRegistrationBean traceFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new TraceFilter());
        registration.addUrlPatterns("/*");
        registration.setName("traceFilter");
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return registration;
    }

    @Bean
    public FilterRegistrationBean userCenterFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new UserCenterFilter(ssoProperties));
        registration.addUrlPatterns("/admin/*");
        registration.setName("userCenterFilter");
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE - 1);
        return registration;
    }

}

*/
